home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
recent
/
iib122.lha
/
IIB
/
Threads
/
Additional
/
IARexx.lha
/
SpiralLite.irx
< prev
next >
Wrap
Text File
|
1997-03-19
|
4KB
|
157 lines
/*
Imagine5.0 Arexx Spiral Lightsource Creator
"What use it is, I'll never know !!"
:-)
1996 Rob Darke - Freely distributable
robda@parallel.demon.co.uk or iml@parallel.demon.co.uk
*/
ADDRESS 'Imagine.1'
NL = '0A'x
IF ~EXISTS('LIBS:rexxreqtools.library') THEN DO
NOTIFY 'Please install the rexxreqtools.library into your LIBS: directory'
NOTIFY 'It is available from /pub/aminet/util/rexx/RexxReqTools.lha'
exit
END
CALL ADDLIB('rexxreqtools.library',0,-30,0)
IF ~EXISTS('LIBS:rexxmathlib.library') THEN DO
CALL rtezrequest('Please install the rexxmathlib.library into your LIBS: directory' || NL || NL ||,
'The library is available from pub/aminet/util/rexx/RexxMathLib1.3.lha','Great, thanks!','Go get RexxMathLib.library','rt_reqpos = reqpos_centerscr')
exit
END
CALL ADDLIB('rexxmathlib.library',0,-30,0)
DISPLAYREXXPTR ON
CALL rtezrequest('Spiral Lightsource Creator - 1996 Rob Darke','Wow!','Spiral Litez','rt_reqpos = reqpos_centerscr')
radius = rtgetlong(25,'Enter spiral radius','Spiral Radius',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
distance = rtgetlong(100,'Enter spiral length','Spiral Length',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
angle = rtgetlong(720,'Enter total rotation angle','Spiral Rotation',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
lights = 0
do while (lights = 0)
lights = rtgetlong(20,'Enter number of lightsources','Total Lightsources',,'rt_reqpos = reqpos_centerscr')
end
if ~rtresult then CALL desist
totalred = rtgetlong(255,'Enter overall RED light level','Lightsource values',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
totalgreen = rtgetlong(255,'Enter overall GREEN light level','Lightsource values',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
totalblue = rtgetlong(255,'Enter overall BLUE light level','Lightsource values',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
axesname = rtgetstring('SPIRAL.LITE','Enter base name for light objects','Object name',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
ret = rtezrequest('I am going to create a spiral set of 'lights' lights' || NL ||,
' Radius = 'radius || NL ||,
' Length = 'distance || NL ||,
' Rotation = 'angle || NL ||,
' Total Red = 'totalred || NL ||,
' Total Green = 'totalgreen || NL ||,
' Total Blue = 'totalblue || NL ||,
' Object base name = 'axesname, ' _Ok | _Abort','Notification','rt_reqpos = reqpos_centerscr')
if ~ret then CALL desist
ret = rtezrequest('It is imperative that you don`t click anywhere whilst I`m' || NL ||,
' doing this, or else things will go very pear-shaped !!!','_Fair Enough | _Abort','Warning','rt_reqpos = reqpos_centerscr')
if ~ret then CALL desist
/* All these vars are required by Imagine - change them if you want but */
/* be sure what you are changing ... */
ATTRIB.LIGHT = ON
ATTRIB.LIGHT_R = totalred/lights
ATTRIB.LIGHT_G = totalgreen/lights
ATTRIB.LIGHT_B = totalblue/lights
ATTRIB.LIGHT_PS = OFF
ATTRIB.LIGHT_PR = ON
ATTRIB.LIGHT_ROUND = OFF
ATTRIB.LIGHT_RECT = OFF
ATTRIB.LIGHT_CS = ON
ATTRIB.LIGHT_SS = OFF
ATTRIB.LIGHT_DI = OFF
ATTRIB.LIGHT_CF = OFF
ATTRIB.LIGHT_NOLF = OFF
/* So now lets begin ... won't this be fun ... */
singleangle = angle / (lights)
singlestep = distance / (lights-1)
pi = 3.141592654
po = (pi * 2)
DETAILEDITOR
ZOOM 1
CENTERAT 0 0 0
OBJECTMODE
MULTIPICKOFF
do i = 0 to (lights-1)
se = ((((singleangle*i) / 360)*po)-pi)
x = (radius * sin(se))
y = (radius * cos(se))
z = (i * singlestep)
ADDAXIS
PICK
TRANSFORM_POSITION x y z
TRANSFORM_ALIGNMENT 90 0 0
ATTRIB.OBJECTNAME = axesname'.'i
SETATTRIBUTES OBJECTNAME
SETATTRIBUTES LIGHT
end
ADDAXIS
PICK
TRANSFORM_ALIGNMENT 90 0 0
TRANSFORMA_SIZE 0 (distance+100) 0
ATTRIB.OBJECTNAME = 'GROUP.'axesname
SETATTRIBUTES OBJECTNAME
MULTIPICKON
do i = 0 to (lights-1)
PICK axesname'.'i
end
MULTIPICKOFF
GROUP
GROUPMODE
DISPLAYREXXPTR OFF
CALL rtezrequest('Job done. Your set of 'lights' spiral lights awaits ...','Thanks Rob!','Spiral Litez','rt_reqpos = reqpos_centerscr')
exit
desist: procedure
DISPLAYREXXPTR OFF
exit
end